#include<iostream>
#include<algorithm>

using namespace std;
const int MAX_N = 510;
const int MAX_DOUBLE = 10000;
int Cm,D,Da,N;
struct info
{
    double price;
    int dis;
};
info stations[MAX_N];

int main(int argc, char const *argv[])
{
    // input
    freopen("test.txt","r",stdin);
    cin>>Cm>>D>>Da>>N;
    for(int i = 0;i<N;++i)
    {
        scanf("%lf %d",&(stations[i].price),&(stations[i].dis) );
    }
    stations[N].price = MAX_DOUBLE; stations[N].dis = D;
    sort(stations,stations+N,[](info& x,info&y){return x.dis<y.dis;});
    
    
    int finished = 1;
    double tprice=0, finaldis=0;
    if(stations[0].dis) finished = 0;
    else
    {
        int i = 0;
        int cpdis = 0,cpdis_max = Cm*Da;
        while(i<N)
        {
            // if 能走到的范围有更便宜的油，本次就不加油
            int flag = 0;
            int maxdis = stations[i].dis+cpdis;

            for(int t = i+1;stations[t].dis<=maxdis;++t)
            {
                if (stations[t].price<stations[i].price)
                {flag = 1;break;}
            }
            // 能走到的范围内没有更便宜的油，
            // 则此次加油加至 min{Cm, (station[cheaper].dis-station[i].dis)/Da} 走到下一个更便宜的油站，或者(没有更便宜的了or 走不到)，就加满，但只要够用到终点即可
            if(!flag)
            {
                int cheaper = -1;
                for(int j = i+1;j<N;++j)
                {
                    if(stations[j].price<stations[i].price){cheaper = j; break;}
                }
                int delta = -cpdis;
                if(cheaper != -1)
                {
                    delta += min(stations[cheaper].dis- stations[i].dis,cpdis_max);
                }
                else
                {
                    delta += min(stations[N].dis-stations[i].dis, cpdis_max);
                }
                delta = max(0,delta);
                cpdis += delta; tprice += delta*stations[i].price;
            }
            // 走到下一个站,最后会走到 stations[N] 也就是终点
            int delta = stations[i+1].dis - stations[i].dis; 
            if(cpdis<delta) // 走不到下一个站, 则无法完成
            {
                finaldis = stations[i].dis + cpdis;
                finished = 0;
                break;
            }
            else
            {
                cpdis -= delta;
                i++;
            }
        }
        
    }
    if(finished)printf("%.2f",tprice/Da);
    else printf("The maximum travel distance = %.2f",finaldis);

    return 0;
}
